# -*- coding:utf-8 -*-

from com.mat.rpa.utils.globalConstants import GlobalConstants
from com.mat.rpa.views.workWindow.leftPanel.directiveTree import treeItem
from . import FTPOperationConstants

class FTPOPerationSubDirectiveTree(treeItem.TreeItemWithID):
    def __init__(self, parent):
        super(FTPOPerationSubDirectiveTree, self).__init__(parent)
        self.createFTPOperationTreeNode()

    def createFTPOperationTreeNode(self):
        self.nodeType = GlobalConstants.treeBranchType
        self.directiveType = "FTPOperation"
        self.setText(0,"FTP操作")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, FTPOperationConstants.FTPOperationConstants.establishingFTPConnectionDirective, "建立FTP连接")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, FTPOperationConstants.FTPOperationConstants.gettingAllFilesDirective, "获取全部文件")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, FTPOperationConstants.FTPOperationConstants.switchingWorkingPathDirective, "切换工作路径")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, FTPOperationConstants.FTPOperationConstants.downloadingFileDirective, "文件下载")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, FTPOperationConstants.FTPOperationConstants.downloadingFileFolderDirective, "文件夹下载")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, FTPOperationConstants.FTPOperationConstants.uploadingFileDirective, "文件上传")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, FTPOperationConstants.FTPOperationConstants.uploadingFileFolderDirective, "文件夹上传")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, FTPOperationConstants.FTPOperationConstants.deletingFileDirective, "文件删除")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, FTPOperationConstants.FTPOperationConstants.renamingFileDirective, "文件重命名")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, FTPOperationConstants.FTPOperationConstants.creatingFileFolderDirective, "创建文件夹")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, FTPOperationConstants.FTPOperationConstants.deletingFileFolderDirective, "删除文件夹")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, FTPOperationConstants.FTPOperationConstants.disconnectingFTPLinkDirective, "断开FTP连接")









